#ifndef _TIMER_HPP_
#define _TIMER_HPP_
#include "TimerResource.hpp"
#include <boost/shared_ptr.hpp>

namespace timer {
//////////////////////////////////////////////////////////////////////////

class Timer
{
public:
	Timer(void (*apFct)(), int aiSpeed);
	Timer(void (*apFct)(void *), void *apParam, int aiSpeed);
	~Timer();

public:
	bool Register();
	bool Unregister();
	bool ChangeSpeed(int aiNewSpeed);
	
private:
	TimerResourceRef m_oTimerResource;

private:
	void (*m_pFunction)();		// TODO: use boost::function for easier reading
	void (*m_pParamFunction)(void *);
	void * m_vpParam;
	int m_iSpeed;
};

typedef boost::shared_ptr<Timer> TimerHandler;

//////////////////////////////////////////////////////////////////////////
} // namespace time
#endif // _TIMER_HPP_
